@inject('appRepository', 'App\Repositories\AppRepository')
@extends('layouts.app',['navShow'=>true])
@php
    $banner = $appRepository->getContentByColumn('ContentPicture',5,'名师介绍','名师介绍banner');
@endphp
@section('title',"培优策-名师介绍")
@section('content')
    @if($banner && count($banner))
        <div id="myCarousel" class="carousel slide" data-ride="carousel">
            <ol class="carousel-indicators">
                @foreach($banner as$key=> $item)
                    <li data-target="#myCarousel" data-slide-to="0" class="{{$key===0?'active':''}}"></li>
                @endforeach
            </ol>
            <div class="carousel-inner">
                @foreach($banner as $key=>$item)
                    <div class="carousel-item {{$key===0?'active':''}}">
                        <img class="img-fluid"
                             src="{{$item->content_detail->assets_path}}"
                             alt="First slide">
                        <div class="container">
                            <div class="carousel-caption text-left">
                                <h1>{{$item->title}}</h1>
                            </div>
                        </div>
                    </div>
                @endforeach
            </div>
            <a class="carousel-control-prev" href="#myCarousel" role="button" data-slide="prev">
                <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                <span class="sr-only">Previous</span>
            </a>
            <a class="carousel-control-next" href="#myCarousel" role="button" data-slide="next">
                <span class="carousel-control-next-icon" aria-hidden="true"></span>
                <span class="sr-only">Next</span>
            </a>
        </div>

    @endif

    <div class="container py-0 my-5" >
        <div class="d-flex justify-content-center my-3">
            <h3>培优策 - 名师介绍</h3>
        </div>
        @foreach($courses as $items)
            <div class="d-flex justify-content-center my-2">
                <p>{{$items->name}}名师</p>
            </div>
            <div class="row teachers-box p-3" style="background-color: transparent">
                @foreach($items->teachers as $item)
                    <div class="col-2 teacher-body m-3 p-0">
                        <img class="img-fluid" src="{{$item->photo}}" alt="">
                        <span class="media-item">
                        <div class="title">
                            <p class="call">{{$item->name}} </p>
                            <p class="name">{{$items->name}}名师</p>
                        </div>
                        <p class="desc">
                            {{$item->profile}}
                        </p>
                    </span>
                    </div>
                @endforeach
            </div>
        @endforeach
    </div>

@endsection